home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16487 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  824 b 

  1. Path: web.cae.ca!usenet
  2. From: Salim Mansouri <salim>
  3. Newsgroups: comp.lang.c++
  4. Subject: Problem with the ifstream class !!!
  5. Date: 8 Apr 1996 22:10:26 GMT
  6. Organization: CAE - Visual Department
  7. Message-ID: <4kc2si$8pp@web.cae.ca>
  8. NNTP-Posting-Host: blackhole.cae.ca
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (X11; I; IRIX 5.3 IP22)
  13. X-URL: news:comp.lang.c++
  14.  
  15. Hi,
  16. I am using the ifstream class for reading an ASCII file. 
  17.  
  18. ex:    char szTmp[255] = "";
  19.     ifstream fin("file.txt");
  20.  
  21.     while (fin)
  22.     {
  23.         fin.getline(szTmp, 250);
  24.         cout<<"The line is : "<<szTmp<<endl;        
  25.     }
  26.  
  27.     The problem is that it reads twice the last line ????
  28. Am i missing something. 
  29. N.B: I am compiling on SGI IRIX 5.3 .
  30.  
  31. Any help will be appreciate. Mail me. 
  32. Thank you
  33. -- 
  34. Salim MANSOURI
  35.  
  36.